<?php
$this->breadcrumbs=array(
		'Transferencia de '.$model->player0->nickname,
);

$buying = $_SESSION['owner']->id == $model->teamBuyer->owner_id;

$this->menu=array(
	array('label'=>'Atualizar Proposta','url'=>array('update','id'=>$model->id), 'visible'=>$buying),
	array('label'=>'Cancelar Proposta','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->id, 'result' => 'CANCELADA'),'confirm'=>'Deseja realmente cancelar a transferência?'), 'visible'=>$buying),
	array('label'=>'Rejeitar Proposta','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->id, 'result' => 'CANCELADA'),'confirm'=>'Deseja realmente rejeitar a transferência?'), 'visible'=>!$buying),
	array('label'=>'Aceitar Proposta','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->id, 'result' => 'ACEITA'),'confirm'=>'Deseja realmente aceitar a transferência?'), 'visible'=>!$buying)

);
?>

<h1 align="center">Detalhes da Transferência</h1>

<span class="span4"><?php echo CHtml::image(Utils::findImageUrl(Utils::getPlayerPhoto($model->player0)[0]->filename),$model->player,array('width'=>100,'height'=>140)); ?></span>

<?php 
if($buying) {
	$photo = Utils::getTeamPhoto($model->teamOwner)[0]->filename;
} else {
	$photo = Utils::getTeamPhoto($model->teamBuyer)[0]->filename;
}
		?>
<span class="span4" align="right"><?php echo CHtml::image(Utils::findImageUrl($photo),$model->player,array('width'=>100,'height'=>140)); ?></span>
<?php $this->widget('bootstrap.widgets.TbDetailView',array(
	'data'=>$model,
	'attributes'=>array(
		array('label'=>'Jogador', 'value'=>$model->player0->name),
		array('label'=>'Clube Atual', 'value'=>$model->teamOwner->name),
		array('label'=>'Clube Pretendido', 'value'=>$model->teamBuyer->name),
		array('label'=>'Preço', 'value'=>'R$ '.$model->price.',00'),
		'status',
		'observation',
	),
)); ?>
